﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Xeml.Sampling;

namespace CompilerControls
{
    public partial class AuthenticationForm : Form
    {
        public AuthenticationForm()
        {
            InitializeComponent();
        }


        AuthenticationRequestEventArgs _args = null;
        public void Setup(AuthenticationRequestEventArgs args, string providerName)
        {
            kryptonHeaderGroup1.ValuesPrimary.Description = "for " + providerName;
            _args = args;
            textBoxUser.DataBindings.Add("Text", args, "UserName", true, DataSourceUpdateMode.OnPropertyChanged);
            textBoxPassword.DataBindings.Add("Text", args, "Password", true, DataSourceUpdateMode.OnPropertyChanged);
        }

        private void kryptonButtonCancel_Click(object sender, EventArgs e)
        {
            if (_args != null)
                _args.Cancel = true;
        }
    }
}
